import uiautomator2 as u2
d=u2.connect()
print(d.dump_hierarchy())